#ifndef ROBOTMAP_H
#define ROBOTMAP_H

#include <QWidget>
#include <QMainWindow>
#include <QTimer>
#include <QGraphicsRectItem>

#include "SqlOperator.h"
#include "RobotMapSystem.h"
#include "RobotItem.h"

namespace Ui {
class RobotMap;
}

class RobotMap : public QWidget
{
    Q_OBJECT

public:
    explicit RobotMap(QWidget *parent = nullptr);
    ~RobotMap();
    /*
    * @Brief: 添加RobotItem
    */
    void addRobotItem(RobotItem* item);

protected:
    void resizeEvent(QResizeEvent* event) override;

private slots:


private:
    Ui::RobotMap *ui;

    MapScene* m_mapScene;   //场景
    QVector<RobotItem*> m_robotItemVector;   //所有的item
//    int m_borderGap = 10;
    QGraphicsRectItem* m_borderItem;    //边界item
    /*
    * @Brief: 初始化画图系统
    */
    void initMapSystem();
};

#endif // ROBOTMAP_H
